package com.scrm.exam.exception;


import com.scrm.exam.errorcode.ErrorCode;

/**
 * @author hqx
 */
public class GzsendiException extends RuntimeException {

	private static final long serialVersionUID = 1L;

	/**
	 * 错误码
	 */
	private  int code;



	public GzsendiException(String message){
		super(message);
		this.code = ErrorCode.ERR_500_FAILURE.getCode();
	}

	public GzsendiException(ErrorCode errorCode) {
		super(errorCode.getMessage());
		this.code = errorCode.getCode();
	}

	public GzsendiException(ErrorCode errorCode, Throwable cause) {
		super(errorCode.getMessage(), cause);
		this.code = code;
	}

	public GzsendiException(String message, int code) {
		super(message);
		if (code == 0) {
			this.code = ErrorCode.ERR_500_FAILURE.getCode();
		}
		this.code = code;
	}


	public GzsendiException(Throwable cause) {
		super(cause);
	}

	public GzsendiException(String message,Throwable cause)
	{
		super(message,cause);
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}
}
